package com.xiaoy.dao;


import java.io.File;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

/*
 * 用于生成表
 */

public class ExportDB {
	
	public void exprotTable () {
		
		
		System.out.println(new File("sss").getAbsolutePath());
		//读取hibernate.cfg.xml文件 "F:/workspace/self/helios/kingdoms.core/hibernate.cfg.xml"
		Configuration cfg = new AnnotationConfiguration().configure();
		SchemaExport export = new SchemaExport(cfg);
		
		export.create(true, true);
	}
	
	
	
	public static void main(String[] args) {
		
		new ExportDB().exprotTable();
		
	}
	
}	
